<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div class="t_bar">
	<span class="color_red">*</span>${param.title }
</div>
	<table  id="response_member" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
			<thead >
					<tr style="organization_finances/financeborder:1px solid #B7D1E6">
						<th class="TblHead" align="center"  width="30px">选择</th>
						<th class="TblHead" align="center"  width="30px">序号</th>
						<th class="TblHead" align="center"  width="100px">姓名</th>
						<th class="TblHead" align="center"  width="200px">所在单位</th>
						<th class="TblHead" align="center"  width="160px">职称</th>
						<th class="TblHead" align="center"  width="135px">职务</th>
						<th class="TblHead" align="center"  >责任范围</th> 
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td>&nbsp;
							<input type="radio" class="radiobutton" name="selResponse" >
						</td>
						<td align="center">
							<span name="response|member[0]@seq_no" >[index]</span> 
						</td>
						<td align="center">
							<input name="response|member[0]|person_name" label="姓名" value="" class=" required input_text " maxlength="35" style="width:80%" />
						</td>
						<td align="center">
							<input name="response|member[0]|org_name" label="所在单位" value="" class=" required input_text "  maxlength="100" style="width:80%" />
						</td>
						
						<td>
							<cpt:tree key="prof_title" cacheable="false" className="" readonly="true" value="" label="职称"  width="100px"
			          		id="response_prof_title_[index]" name="response_prof_title" showPattern="all" shieldPattern="0" onClick="initTreeValueExt"/>
				        	<input type="hidden" name="response|member[0]|response_prof_title_value" class="required" label="职称" value=""/>
			           	<input type="hidden" name="response|member[0]|response_prof_title_name" value=""/>
							
						</td> 
						<td align="center">
							<input name="response|member[0]|position" label="职务" value="" class=" required input_text " maxlength="35"  style="width:80%"  /> 
						</td>
						<td align="center">
							<input name="response|member[0]|responsibility" label="责任范围" value="" maxlength="100"  class=" required input_text " style="width:80%"  /> 
						</td>
					</tr>
					
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/response/member" var="member">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr >
						<td>&nbsp;
							<input type="radio" class="radiobutton" name="selResponse" >
						</td>
						<td align="center">
							<span name="response/member[${flag}${index}]@seq_no" ><x:out select="$member/@seq_no"/></span> 
						</td>
						<td align="center">
							<input value="<x:out select="$member/person_name"/>" label="姓名" name="response/member[${flag}${index}]/person_name" maxlength="35" class="required"  style="width:80%"  /> 
						</td>
						<td align="center">
							<input value="<x:out select="$member/org_name"/>" label="所在单位" name="response/member[${flag}${index}]/org_name" maxlength="100" class="required"  style="width:80%"  /> 
						</td>
						<td>
							<c:set var="prof_title">{'id':'<x:out select="$member/response_prof_title_value" />','name':'<x:out select="$member/response_prof_title_name" />'}</c:set>
			          	<cpt:tree key="prof_title" cacheable="false" className="" readonly="true" value="${prof_title}" label="职称"  width="100px"
			          		id="response_prof_title_${flag}${index}" name="response_prof_title" showPattern="all" shieldPattern="0" onClick="initTreeValueExt"/>
				        	<input type="hidden" name="response/member[${flag}${index}]/response_prof_title_value" class="required" label="职称" value="<x:out select="$member/response_prof_title_value" />"/>
			           	<input type="hidden" name="response/member[${flag}${index}]/response_prof_title_name" value="<x:out select="$member/response_prof_title_name" />"/>
						</td>
						<td align="center">
							<input value="<x:out select="$member/position"/>" label="职务" name="response/member[${flag}${index}]/position" maxlength="35" class="required"  style="width:80%"  />
						</td>
						
						<td align="center">
							<input value="<x:out select="$member/responsibility"/>" label="责任范围" name="response/member[${flag}${index}]/responsibility" class="required"  maxlength="100" style="width:80%"  />
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
				</tbody>
					</table>
					<br/>

					<table width="98%" align="center">
					<tr ><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('response_member',99,'${param.title}最多只能填写99条')){addNewRow('response_member');showDateTag('response_member');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('response_member','selResponse')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('response_member','selResponse')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('response_member','${param.title }')">
					</td></tr>
	</table>
	<br/>
<script type="text/javascript">
$(function() {
	$("#response_member tr:even").addClass("li_1");
	$("#response_member tr:odd").addClass("li_2");
});

function initTreeValueExt(treeId, treeNode) {

	var inputId = treeId.substring(0, treeId.lastIndexOf('_'));
	if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
		scmWarn($("#" + treeId).attr("label")
				+ messageTip.researchAreaInvalidDisciplineCode);
		if (treeNode.level == 0) {
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_code'],[id$='" + inputId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_value'],[id$='" + inputId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_name'],[id$='" + inputId+ "_name']").val("");
		}
		return false;
		}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + inputId + "_code'],[id$='" + inputId+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + inputId + "_value'],[id$='" + inputId+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + inputId + "_name'],[id$='" + inputId+ "_name']").val(str);
	}
</script>